package com.cxso.example.domain.wlpt.waybill;

import com.cxso.example.enums.wlpt.CardTypeEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;

@Setter
@Getter
@Accessors(chain = true)
@Schema(description = "运单投保信息")
public class ApiWaybillInsuranceDomain {

    @Schema(description = "保险产品ID")
    @NotBlank(message = "保险产品不能为空")
    private String insuranceId;

    @Schema(description = "保额")
    @DecimalMin(value = "0.01", message = "货值必需要大于0")
    @NotNull(message = "保额不能为空")
    private BigDecimal coverage;

    @Schema(description = "保险费用")
    @DecimalMin(value = "0.01", message = "货值必需要大于0")
    @NotNull(message = "保险费用不能为空")
    private BigDecimal insuranceFee;

    @Schema(description = "被投保人")
    @NotBlank(message = "被投保人不能为空")
    private String insured;

    @Schema(description = "被投保人证件类型")
    @NotNull(message = "被投保人证件类型不能为空")
    private CardTypeEnum insuredCardType;

    @Schema(description = "被投保人证件号码")
    @NotBlank(message = "被投保人证件号码不能为空")
    private String insuredCardNumber;

    @Schema(description = "被投保人电话")
    @NotBlank(message = "被投保人电话不能为空")
    private String insuredPhone;

}
